package com.scalar.forecast.forecastEntry.actionCommands;

import com.scalar.forecast.actionCommands.ActionCommand;
import com.scalar.forecast.forecastEntry.forms.ForecastEntryForm;
import com.scalar.forecast.commons.Constants;
import org.apache.struts.action.ActionForward;
import org.apache.struts.action.ActionMapping;
import org.apache.struts.action.ActionForm;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

/**
 * User: Sujan Kumar
 * Date: Feb 18, 2005
 * Time: 4:09:20 PM
 */
public class ForecastEntryBuildReloadTableColumnsCommand extends ActionCommand
{
    public ActionForward execute(ActionMapping mapping, ActionForm form, HttpServletRequest request, HttpServletResponse response)
    {
        ActionForward actionForward = mapping.findForward ( "buildForecastEntry" );

        ForecastEntryForm forecastEntryForm = ( ForecastEntryForm ) form;
        actionForward = new ForecastEntrySalesReloadTableColumnsCommand().execute( mapping,form, request, response );
        request.setAttribute( Constants.FORECAST_IS_BUILD, Boolean.toString( forecastEntryForm.isBuild() ) );
        return actionForward;
    }
}
